package com.azarias.dfs;


import com.azaias.dfs.client.FileSystem;
import com.azaias.dfs.client.FileSystemImpl;

/**
 * @description: some desc
 * @author: Azarias_Jx
 * @date: 2021/12/31 14:19
 */
public class client {
    public static void main(String[] args) throws InterruptedException {
        FileSystem fileSystem = new FileSystemImpl();
        Thread a = new Thread() {
            public void run() {
                for (int i = 0; i < 100; i++) {
                    try {
                        fileSystem.mkdir("/usr/warehouse/hive" + i + "_" + Thread.currentThread().getName());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            ;

        };
        a.start();
        Thread c = new Thread() {
            public void run() {
                for (int i = 0; i < 100; i++) {
                    try {
                        fileSystem.mkdir("/usr/warehouse/hive" + i + "_" + Thread.currentThread().getName());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            ;

        };
        c.start();
        Thread b = new Thread() {
            public void run() {
                for (int i = 0; i < 100; i++) {
                    try {
                        fileSystem.mkdir("/usr/warehouse/hive" + i + "_" + Thread.currentThread().getName());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            ;

        };
        b.start();
        a.join();
        b.join();
        c.join();
        fileSystem.showdown(1 + "");
    }
}
